<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增采购单信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-student-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">采购单编号：</label>
                <div class="col-sm-8">
                    <input name="purId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">采购时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="purTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">创建人：</label>
                <div class="col-sm-8">
                    <input name="purchaseUsername" class="form-control" type="text" th:value="${pUser.userName}" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">审核状态：</label>
                <div class="col-sm-8">
                    <select name="status" class="form-control">
                        <option value="1">未审核</option>
                        <option value="2">审核中</option>
                        <option value="3">审核通过</option>
                        <option value="4">审核未通过</option>
                    </select>

                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">品牌：</label>
                <div class="col-sm-8">
                    <select name="brandName" class="form-control m-b">
                        <option th:each="bl : ${brandList}" th:text="${bl.brandName}" th:value="${bl.brandId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">类型：</label>
                <div class="col-sm-8">
                    <select name="poTypeId" class="form-control m-b">
                        <option th:each="tl : ${typeList}" th:text="${tl.typeName}" th:value="${tl.typeId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">型号：</label>
                <div class="col-sm-8">
                    <select name="productId" class="form-control m-b">
                        <option th:each="pl : ${proList}" th:text="${pl.productModel}" th:value="${pl.productId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">厂商：</label>
                <div class="col-sm-8">
                    <select name="firmId" class="form-control m-b">
                        <option th:each="fl : ${firmList}" th:text="${fl.firmName}" th:value="${fl.firmId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">数量：</label>
                <div class="col-sm-8">
                    <input name="num" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">单价：</label>
                <div class="col-sm-8">
                    <input name="buyPrice" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">总金额：</label>
                <div class="col-sm-8">
                    <input name="total" class="form-control" type="text">
                </div>
            </div>


        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "purchase/manage"
        $("#form-student-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/doAdd", $('#form-student-add').serialize());
            }
        }

        $("input[name='studentBirthday']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>